@extends('layouts.admin')

@section('title','店铺列表')

@section('content')
  <!-- Main content -->
  <section class="content">
    <div class="row">
      <div class="col-xs-12">
        <form action="{{ route('admin.shops.destroyAll') }}" method="post">
          {{csrf_field()}}
          <div class="box">
            <div class="box-header">
             <a href="{{ route('admin.shops.create') }}">
             	<button type="button" class="btn bg-olive btn-flat margin">新增</button>
             </a>
             <button class="btn bg-maroon btn-flat margin btn-submit" type="submit" data-check="">删除</button>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
              <table id="example2" class="table table-bordered table-hover">
                <thead>
                <tr>
                	<th></th>
                	<th>id</th>
                  	<th>商店名称</th>
                  	<th>子域名</th>
                  	<th>状态</th>
                  	<th>操作</th>
                </tr>
                </thead>
                <tbody>
                @foreach( $lists as $key => $value )
                <tr>
                	<td><input type="checkbox" name="shop_id[]" value="{{ $value->id }}"></checkbox></td>
                  	<td>{{ $value->id }}</td>
                  	<td>{{ $value->name }}</td>
                  	<td>{{ $value->subdomain }}</td>
                  	<td>
                      @if($value->status == 1)
                      <a href="{{ route('admin.shops.unpublish', ['id'=>$value->id]) }}" class="ajax-get">
                        <button type="button" class="btn btn-success">发布</button>
                      </a>
                      @elseif($value->status == 0)
                      <a href="{{ route('admin.shops.publish', ['id'=>$value->id]) }}" class="ajax-get">
                        <button type="button" class="btn btn-warning">禁用</button>
                      </a>
                      @endif
                    </td>
                  	<td>	
                      <a href="{{ route('admin.shops.edit', ['id'=>$value->id]) }}">
                      <button type="button" class="btn btn-info">编辑</button>
                      </a>
                      <a href="{{ route('admin.shops.destroy', ['id'=>$value->id]) }}" class="ajax-get">
	                  	  <button type="button" class="btn btn-danger">删除</button>
                      </a>
              		</td>
                </tr>
				        @endforeach
              
                </tbody>
              </table>
            </div>
          </div>
        </form>
        
   
      </div>
    </div>
  </section>
  <div class="paginate">{{ $lists->links() }}</div>
@stop